package CoteServeur;
import java.io.*;
import java.net.*;

public class Accepter_connexion implements Runnable{
		 
	    private ServerSocket socketserver = null;
	    private Socket socket = null;
	    private ControleurServeur controleur;

	 
	    public Thread t1;
	    public Accepter_connexion(ServerSocket ss, ControleurServeur cont){
	     socketserver = ss;
	     controleur = cont;
	    }
	     
	    public void run() {
	         
	        try {
	            while(true){
	                 
	            socket = socketserver.accept();
	            System.out.println("Un client veut se connecter  ");
	             
	            t1 = new Thread(new Authentification(socket, controleur));
	            t1.start();
	             
	            }
	        } catch (IOException e) {
	             
	            System.err.println("Erreur serveur");
	        }
	         
	    }
	}